package com.baidu.utils;

import com.baidu.aip.ocr.AipOcr;

import static com.baidu.utils.App.*;

//AipOcrSample 实例化文字识别对象
//配置参数
public class AipOcrSample {

    private static AipOcr aipOcr;

    public static AipOcr getAipOcr(){
        if(aipOcr == null){
            aipOcr = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
            // 可选：设置网络连接参数
            aipOcr.setConnectionTimeoutInMillis(2000);
            aipOcr.setSocketTimeoutInMillis(60000);
        }

        return aipOcr;
    }

}
